home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / mskrmsrc.zip / MSSDEF.H < prev    next >
Text File  |  1991-10-24  |  14KB  |  411 lines

  1. ; File MSSDEF.H
  2.     .xlist            ; suppress listing in program
  3.     .sall            ; don't list macro expansions
  4. version equ    311        ; master version number
  5. verdef    macro
  6.     db    ' MS-DOS Kermit: 3.11 7 Sept 1991'
  7.     endm
  8.  
  9. BELL    EQU    07H
  10. TAB     EQU    09H
  11. LF      EQU    0AH
  12. FF      EQU    0CH
  13. CR      EQU    0DH
  14. XON     EQU    11H
  15. XOFF    EQU    13H
  16. ESCAPE     EQU    1BH
  17. DEL     EQU    7FH
  18. BS      EQU    08H
  19. CTLZ    EQU    1AH
  20. SOH     EQU    01H     ; Start of header char
  21. SPC     EQU    20H
  22. SS2    equ    8eh
  23. SS3    equ    8fh
  24. DCS    equ    90h
  25. CSI    equ    9bh
  26. STCHR    equ    9ch
  27.  
  28. DOS     EQU    21H
  29.  
  30. CONIN    EQU    01H
  31. CONOUT    EQU    02H
  32. LSTOUT    EQU    05H
  33. DCONIO    EQU    06H
  34. CONINQ    EQU    07H    ; quiet console input
  35. PRSTR    EQU    09H
  36. CONSTAT    EQU    0BH
  37. SELDSK    EQU    0EH    ; Select disk
  38. GCURDSK    EQU    19H    ; Current disk
  39. SETDMA    EQU    1AH
  40. GETDATE EQU    2AH    ; Get date
  41. GETTIM    EQU    2CH    ; Get the time of day 
  42. DOSVER    EQU    30H    ; dos version #
  43. GSWITCH    EQU    37H    ; undocumented get/set switch character
  44. CHDIR    EQU    3BH    ; change directory
  45. CREAT2    EQU    3CH    ; create
  46. OPEN2    EQU    3DH    ; open
  47. CLOSE2    EQU    3EH    ; close
  48. READF2    EQU    3FH    ; read
  49. WRITE2    EQU    40H    ; write
  50. DEL2    EQU    41H    ; delete
  51. LSEEK    EQU    42H    ; lseek
  52. IOCTL    EQU    44H    ; i/o control
  53. GCD    EQU    47H    ; get current directory
  54. ALLOC    EQU    48H    ; allocate memory
  55. FREEMEM    EQU    49H    ; free memory
  56. SETBLK    EQU    4AH    ; modify allocated memory map
  57. EXEC    EQU    4BH    ; execute task
  58. FIRST2    EQU    4EH    ; search for first
  59. NEXT2    EQU    4FH    ; search for next
  60.  
  61. PAREVN    EQU    00    ; Even parity
  62. PARMRK    EQU    01    ; Mark parity
  63. PARNON    EQU    02    ; No parity.    
  64. PARODD    EQU    03    ; Odd parity
  65. PARSPC    EQU    04    ; Space parity
  66.  
  67. FLOXON    EQU    1113H    ; Use XON/XOFF for flow control
  68. FLONON    EQU    0    ; Don't do flow control
  69. DEFHAND    EQU    XON    ; Use XON as default handshake
  70.  
  71. MODCD    EQU    80H    ; MODEM CD handshake line status responses
  72. MODCTS    EQU    10H    ; MODEM CTS
  73. MODDSR    EQU    20H    ; MODEM DSR
  74.  
  75.             ; flags.remflg byte definitions
  76. DQUIET    EQU    1    ; Display mode, suppress file xfer statistics
  77. DREGULAR EQU    2    ; Regular formatted screen display of statistics
  78. DSERIAL    EQU    4    ; Serial mode (non-formatted screen)
  79. D8BIT    EQU    8    ; Display chars as 8-bit vs 7-bit quantities
  80. DSERVER    EQU    10H    ; Server mode active, if this bit is set
  81.  
  82. MAXTAK    EQU    25    ; Max number of TAKE's allowed
  83. DEFMXTRY EQU    5    ; default number of retries on a data packet (63 max)
  84.             ; Init packet gets three times this number of tries
  85.  
  86. DEFESC    EQU    1DH    ; The default escape character (Control rt sq bracket)
  87. DRPSIZ    EQU    94    ; Default receive packet size, regular pkts
  88. DSPSIZ    EQU    94    ; Default send packet size, regular pkts
  89. DSTIME    EQU    8    ; Default send time out interval
  90. DSQUOT    EQU    23H    ; Default send (and receive) quote char
  91. DQBIN    EQU    26H    ; Default 8-bit prefix
  92. DCHKLEN    EQU    1    ; Default checksum length
  93. DEFPAR    EQU    PARNON    ; Default parity (none) 
  94.  
  95. maxpack    equ    2000    ; max packet length. Sets buffer sizes, capabilities
  96. bufsiz    equ    1536    ; size of serial port input buffer
  97. buffsz    equ    512    ; size of disk file i/o buffer (buff)
  98. cmdblen    equ    maxpack/2 ; length of command lines (sharing buffers)
  99. cptsiz    equ    256    ; size of session capture buffer
  100. tbufsiz    equ    128    ; size of Take buffers
  101. maxwind equ    31    ; max number of window slots
  102. macmax    equ    100    ; max number of macros
  103.  
  104.             ; bit defs for flags.capflg (LOG command)
  105. logoff    equ    0    ; Off = no or suspended logging
  106. logdeb    equ    1    ; log debugging (not yet imp)
  107. logpkt    equ    2    ; log packets sent/received
  108. logses    equ    4    ; log connect mode session
  109. logtrn    equ    8    ; log (file) transaction
  110.  
  111.             ; Attributes-allowed bits in flags.attflg 
  112. attchr    equ    1    ; File Character-set
  113. attdate    equ    2    ; File Date/Time
  114. attlen    equ    4    ; File Length
  115. atttype    equ    8    ; File Type
  116.  
  117. ; Terminal emulator section
  118.  
  119. ; Kinds of terminals available
  120. ttgenrc equ    0            ; no emulation done by Kermit
  121. ttheath equ    1            ; Heath-19
  122. ttvt52    equ    2            ; VT52
  123. ttvt100    equ    4            ; VT100
  124. ttvt102    equ    8            ; VT102
  125. ttvt220    equ    10h            ; VT220
  126. ttvt320    equ    20h            ; VT320
  127. tttek    equ    40h            ; Tektronix 4010
  128. tthoney    equ    80h            ; Honeywell VIP7809
  129. TTTYPES equ    9            ; Number of terminal types defined
  130.  
  131. ; DEC emulator status flags (bits in words vtemu.vtflgst and vtemu.vtflgop)
  132. anslnm  equ    1H            ; ANSI line feed/new line mode
  133. decawm  equ    2H            ; DEC autowrap mode
  134. decscnm equ    80H            ; DEC screen mode
  135. decckm  equ    200H            ; DEC cursor keys mode
  136. deckpam equ    400H            ; DEC keypad application mode
  137. decom   equ    800H            ; DEC origin mode
  138. deccol    equ    1000H            ; DEC column mode (0=80 col)
  139. decanm  equ    2000H            ; ANSI mode
  140. dececho equ    4000H            ; ANSI local echo on (1 = on)
  141.      
  142. ; Terminal SETUP mode flags (joint with bits above, some name dups)
  143. vsnewline    equ    1H        ; ANSI new line (0 = off)
  144. vswrap        equ    2H        ; Line wrap around (0 = no wrap)
  145. vsnrcm        equ    4H        ; National Rep Char set (0=none)
  146. vswdir        equ    8H        ; Writing direction (0=left, 1 right)
  147. vskeyclick    equ    10H        ; Keyclick (0 = off)
  148. vsmarginbell    equ    20H        ; Margin bell (0 = off)
  149. vscursor    equ    40H        ; Cursor (0 = block, 1 = underline)
  150. vsscreen    equ    80H        ; Screen (0 = normal, 1 = rev. video)
  151. vscntl        equ    100h        ; 8 or 7 bit controls (1 = 8-bit)
  152.      
  153. ; VTxxx defaults for SETUP
  154. ; Note: Tab stops default to columns 9, 17, 25, 33, etc
  155. ;
  156. ; VSDEFAULTS holds Kermit startup time settings for the VT100 emulator
  157. ; Configure it by adding together names from the setup mode flags above
  158. ; to turn on features (they default to being off if not mentioned).
  159. ; Set the kind of terminal by placing a ttxxxx name in VTFLGS in the
  160. ; FLGINFO structure well below.
  161.  
  162. vsdefaults    equ    0+vscursor    ; + your favorite conditions
  163.  
  164. emulst    struc            ; structure for terminal emulator global data
  165. vtflgst    dw    0        ; VTxxx setup flags
  166. vtflgop    dw    0        ; VTxxx runtime flags, like setup flags
  167. vttbs    dw    0        ; pointer to default tab stops 
  168. vttbst    dw    0        ; pointer to tab stops (both in mszibm)
  169. vtchset    db    15        ; value of default character set (15=Latin-1)
  170. vtchop    db    15        ; value of operational char set
  171. att_ptr    dw    0        ; pointer to video attributes: norm, rev
  172. vttable db    4 dup (0ffh)    ; char set number for G0..G3 overrides
  173. emulst    ends
  174. ; end of terminal emulator section
  175.  
  176. ; Structure definitions
  177.  
  178. ifdef save_mem2            ; define only for Xenix builds
  179. save_mem equ    1        ; for Xenix
  180. endif
  181.  
  182. ifndef save_mem2        ; for regular DOS builds
  183. ; Command parser information
  184. cmdinfo    struc
  185. cmrprs    dd 0        ; offset,segment of where to jmp on reparsing
  186. cmostp  dw 0
  187. cmprmp    dw 0        ; Address of prompt
  188. cmwhite    db 0        ; non-zero to permit leading whitespace
  189. cmcr    db 0        ; Say whether bare CR is allowed
  190. cmper    db 0        ; Allow literal backslash-percent in command
  191. cmquiet    db 0        ; non-zero for no echoing
  192. cmkeep    db 0        ; non-zero to keep Take/Macro open after EOF
  193. cmblen    dw 0        ; length of caller's cmtxt receiving buffer
  194. impdo    db 0        ; non-zero for keyword search failure to use DO cmd
  195. cmdinfo    ends
  196.  
  197. ; Command parser equates
  198. cmkey    equ    1    ; parse a keyword
  199. cmeol    equ    4    ; parse a CR end of line character
  200. cmline    equ    5    ; parse line of text up to CR
  201. cmword    equ    6    ; parse an arbitrary word
  202.  
  203. endif
  204.  
  205. ; Flags information
  206. flginfo    struc
  207. belflg    db 1        ; Use bell
  208. comflg    db 1        ; Use COM1 by default
  209. abfflg    db 1        ; Discard incoming file if abort
  210. debug    db 0        ; Debugging mode (default off)
  211. flwflg    db 0        ; File warning (collision) flag (default rename)
  212. extflg    db 0        ; Exit flag (default off)
  213. vtflg    db ttvt320    ; term emulation type, default
  214. cxzflg    db 0        ; ^X/^Z to interrupt file x-fer
  215. xflg    db 0        ; Seen "X" packet
  216. eoflag    db 0        ; EOF flag; non-zero on EOF
  217. capflg    db 0        ; On if capturing data
  218. takflg    db 0        ; On if echoing commands of TAKE file
  219. timflg    db 1        ; Say if are timing out or not
  220. destflg    db 1        ; Incoming files destination: disk or printer
  221. eofcz    db 0        ; ^Z signals eof if non-zero
  222. remflg    db DREGULAR    ; server (remote) mode plus display flag bits
  223. modflg    db 1        ; non-zero if mode line on
  224. attflg    db 0ffh        ; non-zero if file attributes packets are enabled
  225. chrset    dw 0        ; ident of file character set (437=hardware, CP437)
  226. unkchs    db 0        ; files w/unknown-character-set (0=keep, 1=cancel)
  227. xltkbd    db 1        ; keyboard character-set translation (1=on, 0=off)
  228. flginfo    ends
  229.  
  230. ifndef save_mem2
  231. ; Transmission parameters
  232. trinfo    struc
  233. maxdat    dw 0        ; Max packet size for send, word for long packets
  234. chklen    db 1        ; Number of characters in checksum
  235. seol      db cr        ; Send EOL char
  236. reol      db cr        ; Receive EOL char
  237. ssoh      db soh        ; Send start-of-packet character
  238. rsoh      db soh        ; Receive start-of-packet character
  239. squote    db dsquot    ; Send quote character
  240. rquote    db dsquot    ; Receive quote character
  241. rptq    db 7eh        ; Repeat quote character (tilde)
  242. spsiz     db dspsiz    ; Send (regular) packet size
  243. rpsiz     db drpsiz    ; Receive (regular) packet size
  244. stime     db dstime    ; Send timeout. (Don't timeout)
  245. rtime     db 5        ; Receive timeout
  246. sdelay    db 0        ; Send delay time (sec) for just SEND command
  247. spad      db 0        ; Send number of padding char
  248. rpad      db 0        ; Receive number of padding char
  249. spadch    db 0        ; Send padding char
  250. rpadch    db 0        ; Receive padding char
  251. ebquot    db 'Y'        ; Send 8-bit quote character
  252. escchr    db defesc    ; Escape character
  253. capas    db 2,0        ; Capas bytes (just two for now)
  254. windo    db 1        ; number of window slots
  255. rlong    dw drpsiz    ; long pkt size we want to receive
  256. slong    dw maxpack    ; long pkt size we could send (negotiated with host)
  257. xchset    db 0        ; transfer char set (0=hardware) on comms wire
  258. xtype    db 0        ; file type for xfer (0=text,1=binary,etc)
  259. sdbl    db 0        ; char to be doubled when sending (if non-null)
  260. rign    db 0        ; char to be ignored when received (if non-null)
  261. trinfo    ends
  262. endif
  263.  
  264. ifndef save_mem
  265. pktinfo    struc
  266. datadr    dw 0        ; data field address (offset from DS)
  267. datlen    dw 0        ; length of data field in a packet
  268. datsize    dw 0        ; length of data field buffer
  269. pktype    db 0        ; packet type, a letter
  270. seqnum    db 0        ; packet SEQ number
  271. ackdone    db 0        ; zero if pkt not ack'ed yet
  272. numtry    db 0        ; number of tries on this packet
  273. pktinfo    ends
  274. endif
  275.  
  276. filest    struc
  277. dta    db 26 dup(0)    ; DOS, 21 resev'd bytes, file attr, 2 each date & time
  278. sizelo    dw 0        ; DOS, file size double word
  279. sizehi    dw 0
  280. fname    db 13 dup(0)    ; DOS, filename, asciiz, with dot. End of DOS section
  281. handle    dw -1        ; Kermit, file handle
  282. string    db 64 dup(0)    ; Kermit, filename string, including drive and path
  283. fstat    db 0        ; Kermit, status of Find First DOS call
  284. filest    ends
  285.  
  286. takinfo    struc        ; Take file structure
  287. taktyp    db 0        ; type: 0FEh = valid file handle, 0FFh = a macro
  288. takhnd    dw 0        ; file handle
  289. takbuf    dw 0        ; offset of Take buffer
  290. takptr    dw 0        ; pointer in buffer to next char to read
  291. takcnt    dw 0        ; number of unread bytes in buffer
  292. takctr    dw 0        ; COUNT variable for script program control
  293. takargc    dw 0        ; argument quantity count
  294. takinfo ends
  295.  
  296. ; Port Information
  297. prtinfo    struc
  298. baud    dw 0        ; Default baud rate
  299. ecoflg    db 0        ; Local echo flag (default off)
  300. parflg    db 0        ; Parity flag (default none)
  301. floflg    db 0        ; If need flow control
  302. hndflg    db 0        ; If need handshake during file transfer
  303. hands    db 0        ; Default handshake
  304. flowc    dw 0        ; Do flow control with XON/XOFF
  305. duplex    db 0        ; Do full (0) or half (1) duplex comms
  306. portrdy db 0        ; Non-zero if comms port is still active
  307. prtinfo    ends
  308.                 ; ENABLE/DISABLE bits for denyflg
  309. cwdflg    equ    1        ; deny remote cwd
  310. delflg    equ    2        ; deny remote del
  311. dirflg    equ    4        ; deny remote dir
  312. hostflg    equ    8        ; deny remote host
  313. spcflg    equ    10H        ; deny remote space
  314. finflg    equ    20H        ; deny fin, bye, logo to server
  315. getsflg    equ    40H        ; deny paths in get cmds to server
  316. sndflg    equ    80H        ; deny paths in send cmds to server
  317. typflg    equ    100H        ; deny paths in type
  318. pasflg    equ    200h        ; username/password required
  319. kerflg    equ    400h        ; deny remote kermit
  320. prtflg    equ    800h        ; deny remote print
  321. tekxflg    equ    8000h        ; deny automatic Tektronix invokation
  322.  
  323. ifndef save_mem
  324. statinfo struc            ; statistics, basic information layout
  325. prbyte    dw    2 dup (0)    ; number of bytes received by port
  326. psbyte    dw    2 dup (0)    ; number of bytes sent to port
  327. frbyte    dw    2 dup (0)    ; bytes received
  328. fsbyte    dw    2 dup (0)    ; bytes sent
  329. prpkt    dw    2 dup (0)    ; number of packets received
  330. pspkt    dw    2 dup (0)    ; number of packets sent
  331. nakrcnt    dw    0        ; count of naks received
  332. nakscnt    dw    0        ; count of naks sent
  333. btime    dw    2 dup (0)    ; start time (seconds) of transfer
  334. etime    dw    2 dup (0)    ; elapsed time (seconds) of transfer
  335. pretry    dw    0        ; packet retries
  336. xstatus    db    0        ; transfer status
  337. xname    db    64 dup (0)    ; alias (send/receive as) filename
  338. statinfo ends
  339.  
  340. endif
  341.  
  342. scptinfo struc            ; scripts
  343. inactv    db    0        ; input action value (default proceed)
  344. incasv    db    0dfh        ; input case  (default ignore)
  345. indfto    dw    1        ; input and pause timeout (def 1 sec)
  346. inecho    db    1        ; echo Input cmd text (0 = no)
  347. xmitfill db    0        ; non-zero to TRANSMIT filler for blank line
  348. xmitlf    db    0        ; non-zero to TRANSMIT LF's
  349. xmitpmt    db    lf        ; default prompt for line acknowledgments
  350. scptinfo ends
  351.  
  352. ; definitions for terminal handler:
  353. termarg    struc
  354. flgs    db 0        ; flags
  355. prt    db 0        ; port to use (0,1,etc)
  356. captr    dw 0        ; routine to call with captured data
  357. baudb    db 0        ; baud rate bits
  358. parity    db 0        ; parity
  359. termarg    ends
  360.  
  361. ; bits for flag byte
  362. capt    equ 40h        ; capture output
  363. emheath    equ 20h        ; emulate heath
  364. trnctl    equ 08h        ; translate controls (debug)
  365. modoff    equ 04h        ; mode line off
  366. lclecho    equ 01h        ; local echo
  367.  
  368. ; bits for kstatus general Kermit status word
  369. kssuc    equ    0000h    ; success condition
  370. kssend    equ    0001h    ; send file failed
  371. ksrecv    equ    0002h    ; get/receive file failed
  372. ksrem    equ    0004h    ; Remote command failed
  373. kstake    equ    0008h    ; Take file failure
  374. ksgen    equ    0010h    ; general command failure
  375. ksuser    equ    0080h    ; user intervention (aka Control-C)
  376.  
  377. mkeyw    macro    key,value    ; widely used data structure
  378.     local    keylen,start
  379. start    equ    $        ; remember start address of structure
  380.     dw    keylen        ; length of "key"
  381.     db    key        ; "key" itself
  382. keylen    equ    $-(start+2)    ; number of bytes in "key"
  383.     dw    value        ; action value
  384.     endm
  385. ;
  386. ; Note well. The following segment references are in THIS file to provide
  387. ; the desired ordering of them in memory. To wit: lowest addresses for
  388. ; 'code', followed by 'data', and only then by 'stack'.
  389. code    segment public 'kcode'
  390. code    ends
  391. code1    segment public 'kcode'
  392. code1    ends
  393. code2    segment public 'kcode'
  394. code2    ends
  395. data    segment public 'kdata'
  396. data    ends
  397. data1    segment public 'kdata'
  398. data1    ends
  399. _TEXT    SEGMENT  WORD PUBLIC 'CODE'
  400. _TEXT    ENDS
  401. _DATA    SEGMENT  WORD PUBLIC 'DATA'
  402. _DATA    ENDS
  403. CONST    SEGMENT  WORD PUBLIC 'CONST'
  404. CONST    ENDS
  405. _BSS    SEGMENT  WORD PUBLIC 'BSS'
  406. _BSS    ENDS
  407. _STACK    SEGMENT    WORD STACK 'STACK'
  408. _STACK    ENDS
  409. DGROUP    GROUP    CONST, _BSS, _DATA, _STACK
  410.     .list
  411.